<%@page contentType="text/html" %>
<%@page pageEncoding="UTF-8" %>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Goodwill - Установка статуса заказ</title>
    <link rel="stylesheet" href="resources/css/main.css"/>
    <link rel="stylesheet" href="resources/css/stylesheet.css"/>
    <link rel="stylesheet" href="resources/css/simple_tables.css"/>
    <style type="text/css">
    </style>
</head>
<body style="padding:5px">
<f:view>
    <jsp:include page="status.jsp"/>
    <jsp:include page="messages.jsp"/>
    <h:form>
        <h:outputText value="Номер заказа"/>
        <h:inputText value="#{OrderStatBean.orderId}" styleClass="f_tb_l" style="vertical-align:middle"
                     required="true"
                     requiredMessage="Поле Номер заказа должно быть заполнено"
                     converterMessage="Номер заказа должен быть числом"/>
        <a4j:commandLink action="#" reRender="dvActions">
            <h:outputText value="выбрать" style="font-size:110%;"/>
        </a4j:commandLink>

        <h:panelGroup id="dvActions" layout="block">
            <h:panelGrid columns="2" cellpadding="0" cellspacing="0" columnClasses="dleft,dright" styleClass="tbl2">
                <h:outputText value="Текущий статус"/>
                <h:outputText value="#{OrderStatBean.order.orderStateAsString}"/>
                <h:outputText value="Новый статус"/>
                <h:selectOneMenu value="#{OrderStatBean.orderState}">
                    <f:selectItems value="#{OrdersBean.orderStates}"/>
                </h:selectOneMenu>
                <a4j:commandButton value="Установить" action="#{OrderStatBean.changeOrderState}" reRender="dvActions"/>
            </h:panelGrid>
        </h:panelGroup>

    </h:form>

</f:view>
</body>
</html>
